#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.db.models import Sum
from rest_framework import serializers



from vehicle.models import VehicleInfoModel, VehicleFaultInfoModel, VehicleFaultLogModel, VehicleFenceModel, VehicleMoveInfoModel
from application.settings import redis_cli
from dvadmin.utils.serializers import CustomModelSerializer


class VehicleInfoModelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = VehicleInfoModel
        fields = "__all__"



class VehicleFaultInfoModelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = VehicleFaultInfoModel
        fields = "__all__"




class VehicleFaultLogModelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = VehicleFaultLogModel
        fields = "__all__"




class VehicleFenceModelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = VehicleFenceModel
        fields = "__all__"





class VehicleMoveInfoModelSerializer(CustomModelSerializer):
    """
    序列化器
    """

    class Meta:
        model = VehicleMoveInfoModel
        fields = ["vehicle_vin","start_time","end_time","score","offset"]


